{% load i18n %}
{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>
        {% block head_title %}
            首页
        {% endblock %}
    </title>
    <link href="{% static 'favicon.ico' %}" rel="shortcut icon" type="image/x-icon">
    <link href="{% static 'component/fontawesome/css/font-awesome.min.css' %}" rel="stylesheet">
    <link rel="stylesheet" href="{% static 'component/layui/css/layui.css' %}" media="all">
    <link href="{% static 'common/css/reset.css' %}" rel="stylesheet">
    <link href="{% static 'common/css/_base.css' %}" rel="stylesheet">
    {% block custom_style %}{% endblock %}
</head>
<body>
{% block nav %}
    <ul class="layui-nav nav-head clearfloat">
        <li class="layui-nav-item"><a class="navbar-brand" href="#">LOGO</a></li>
        <!--登录后跳转-->
        {% if request.user.is_authenticated %}
            <li class="layui-nav-item">
                <img src="{{ request.user.mugshot_thumbnail.url }}" style='width:40px;position: relative;top: 5px;'/>
            </li>
            <li class="layui-nav-item"><a href="#">{{ request.user.username }}</a></li>
            <li class="layui-nav-item"><a href="{% url 'accounts:logout' %}">退出</a></li>
        {% else %}
            <li class="layui-nav-item"><a href="{% url 'accounts:login' %}">登录</a></li>
            <li class="layui-nav-item"><a href="{% url 'accounts:register' %}">注册</a></li>
        {% endif %}
    </ul>
{% endblock %}
{% block main %}
{% endblock %}
<script src="{% static 'common/js/jquery1.12.4.min.js' %}"></script>
<script src="{% static 'common/js/jquery.cookie.js' %}"></script>
<script src="{% static 'component/layui/layui.js' %}"></script>
<script>
    $(function () {
        layui.use('element', function () {
            console.log("注册element完成");
        });
    })
</script>
{% block custom_script %}{% endblock %}
</body>
</html>